package net.xdclass.controller;

import jakarta.annotation.Resource;
import net.xdclass.dto.ReportDTO;
import net.xdclass.req.ReportSaveReq;
import net.xdclass.service.ReportService;
import net.xdclass.util.JsonData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/report")
public class ReportController {

    @Resource
    private ReportService reportService;

    @PostMapping("/save")
    public JsonData save(@RequestBody ReportSaveReq req) {
        ReportDTO reportDTO = reportService.save(req);
        return JsonData.buildSuccess(reportDTO);
    }
}
